using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Fields
{
    /// <summary>
    /// <para>Encode Field</para>
    /// <para>Converts categorical values (string, integer, or date) into multiple numerical fields, each representing a category. The encoded numerical fields can be used in most data science and statistical workflows including regression models.</para>
    /// <para>将分类值（字符串、整数或日期）转换为多个数值字段，每个数值字段表示一个类别。编码的数值字段可用于大多数数据科学和统计工作流，包括回归模型。</para>
    /// </summary>    
    [DisplayName("Encode Field")]
    public class EncodeField : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public EncodeField()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The input table or feature class containing the field to be encoded. Fields will be added to the existing input table and will not create a new output table.</para>
        /// <para>包含要编码的字段的输入表或要素类。字段将添加到现有输入表中，不会创建新的输出表。</para>
        /// </param>
        /// <param name="_field">
        /// <para>Field to Encode</para>
        /// <para>The field containing the categorical or temporal values to be encoded.</para>
        /// <para>包含要编码的分类值或时态值的字段。</para>
        /// </param>
        public EncodeField(object _in_table, object _field)
        {
            this._in_table = _in_table;
            this._field = _field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Encode Field";

        public override string CallName => "management.EncodeField";

        public override List<string> AcceptEnvironments => ["extent"];

        public override object[] ParameterInfo => [_in_table, _field, _method.GetGPValue(), _time_step_interval, _time_step_alignment.GetGPValue(), _reference_time, _updated_table];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The input table or feature class containing the field to be encoded. Fields will be added to the existing input table and will not create a new output table.</para>
        /// <para>包含要编码的字段的输入表或要素类。字段将添加到现有输入表中，不会创建新的输出表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Field to Encode</para>
        /// <para>The field containing the categorical or temporal values to be encoded.</para>
        /// <para>包含要编码的分类值或时态值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field to Encode")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field { get; set; }


        /// <summary>
        /// <para>Encoding Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method to use to encode the values contained in the Field to Encode parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>One-hot—Each categorical value will be converted to a new field and the values 0 and 1 will be assigned, where 1 represents the presence of that categorical value. This is the default.</bullet_item><para/>
        ///     <bullet_item>One-cold— Each categorical value will be converted to a new field and the values 0 and 1 will be assigned, where 0 represents the presence of that categorical value.</bullet_item><para/>
        ///     <bullet_item>Temporal—Each temporal value in the Field to Encode parameter will be converted to an integer based on the time step interval, time step alignment, and reference time specified.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于对“要编码的字段”参数中包含的值进行编码的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>One-hot—每个分类值将转换为一个新字段，并将分配值 0 和 1，其中 1 表示该分类值的存在。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>One-cold— 每个分类值将转换为一个新字段，并将分配值 0 和 1，其中 0 表示该分类值的存在。</bullet_item><para/>
        ///     <bullet_item>时间—要编码的字段参数中的每个时态值将根据指定的时间步长间隔、时间步长对齐和参考时间转换为整数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Encoding Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._ONEHOT;

        public enum _method_value
        {
            /// <summary>
            /// <para>One-hot</para>
            /// <para>One-hot—Each categorical value will be converted to a new field and the values 0 and 1 will be assigned, where 1 represents the presence of that categorical value. This is the default.</para>
            /// <para>One-hot—每个分类值将转换为一个新字段，并将分配值 0 和 1，其中 1 表示该分类值的存在。这是默认设置。</para>
            /// </summary>
            [Description("One-hot")]
            [GPEnumValue("ONEHOT")]
            _ONEHOT,

            /// <summary>
            /// <para>One-cold</para>
            /// <para>One-cold— Each categorical value will be converted to a new field and the values 0 and 1 will be assigned, where 0 represents the presence of that categorical value.</para>
            /// <para>One-cold— 每个分类值将转换为一个新字段，并将分配值 0 和 1，其中 0 表示该分类值的存在。</para>
            /// </summary>
            [Description("One-cold")]
            [GPEnumValue("ONECOLD")]
            _ONECOLD,

            /// <summary>
            /// <para>Temporal</para>
            /// <para>Temporal—Each temporal value in the Field to Encode parameter will be converted to an integer based on the time step interval, time step alignment, and reference time specified.</para>
            /// <para>时间—要编码的字段参数中的每个时态值将根据指定的时间步长间隔、时间步长对齐和参考时间转换为整数。</para>
            /// </summary>
            [Description("Temporal")]
            [GPEnumValue("TEMPORAL")]
            _TEMPORAL,

        }

        /// <summary>
        /// <para>Time Step Interval</para>
        /// <para>The number of seconds, minutes, hours, days, weeks, or years that will represent a single time step. The temporal value will be aggregated into a certain time step it is within. If no value is provided, the default time step interval is based on two algorithms that are used to determine the optimal number and width of the time step intervals. The smaller of the two results is used as the time step interval.</para>
        /// <para>表示单个时间步长的秒数、分钟数、小时数、天数、周数或年数。时间值将被聚合到它所处的某个时间步长中。如果未提供任何值，则默认时间步长间隔基于两种算法，用于确定时间步长间隔的最佳数量和宽度。两个结果中较小的一个用作时间步长间隔。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Step Interval")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_step_interval { get; set; } = null;


        /// <summary>
        /// <para>Time Step Alignment</para>
        /// <para><xdoc>
        ///   <para>Specifies how aggregation will occur based on the Time Step Interval parameter value.</para>
        ///   <bulletList>
        ///     <bullet_item>End time— Time steps will align to the last time event and aggregate back in time. This is the default.</bullet_item><para/>
        ///     <bullet_item>Start time— Time steps will align to the first time event and aggregate forward in time.</bullet_item><para/>
        ///     <bullet_item>Reference time— Time steps will align to the date and time specified in the Reference Time parameter. Aggregation is performed forward and backward in time from the reference time until reaching the first and last temporal values.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何根据 Time Step Interval 参数值进行聚合。</para>
        ///   <bulletList>
        ///     <bullet_item>结束时间— 时间步长将与上次时间事件对齐，并按时间聚合。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>开始时间— 时间步长将与首次时间事件对齐，并在时间上向前聚合。</bullet_item><para/>
        ///     <bullet_item>参考时间— 时间步长将与参考时间参数中指定的日期和时间对齐。聚合从参考时间开始向前和向后执行，直到达到第一个和最后一个时间值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Step Alignment")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _time_step_alignment_value _time_step_alignment { get; set; } = _time_step_alignment_value._END_TIME;

        public enum _time_step_alignment_value
        {
            /// <summary>
            /// <para>End time</para>
            /// <para>End time— Time steps will align to the last time event and aggregate back in time. This is the default.</para>
            /// <para>结束时间— 时间步长将与上次时间事件对齐，并按时间聚合。这是默认设置。</para>
            /// </summary>
            [Description("End time")]
            [GPEnumValue("END_TIME")]
            _END_TIME,

            /// <summary>
            /// <para>Start time</para>
            /// <para>Start time— Time steps will align to the first time event and aggregate forward in time.</para>
            /// <para>开始时间— 时间步长将与首次时间事件对齐，并在时间上向前聚合。</para>
            /// </summary>
            [Description("Start time")]
            [GPEnumValue("START_TIME")]
            _START_TIME,

            /// <summary>
            /// <para>Reference time</para>
            /// <para>Reference time— Time steps will align to the date and time specified in the Reference Time parameter. Aggregation is performed forward and backward in time from the reference time until reaching the first and last temporal values.</para>
            /// <para>参考时间— 时间步长将与参考时间参数中指定的日期和时间对齐。聚合从参考时间开始向前和向后执行，直到达到第一个和最后一个时间值。</para>
            /// </summary>
            [Description("Reference time")]
            [GPEnumValue("REFERENCE_TIME")]
            _REFERENCE_TIME,

        }

        /// <summary>
        /// <para>Reference Time</para>
        /// <para><xdoc>
        ///   <para>The date and time to which the time-step intervals will align. For example, to bin your data weekly from Monday to Sunday, set a reference time of Sunday at midnight to ensure that the time steps break between Sunday and Monday at midnight.</para>
        ///   <para>The value can be a date and time or solely a date; it cannot be solely a time. The expected format is determined by the computer's regional time settings.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>时间步长间隔将对齐的日期和时间。例如，若要每周从周一到周日对数据进行装箱，请将参考时间设置为周日午夜，以确保周日和周一午夜之间的时间步长中断。</para>
        ///   <para>该值可以是日期和时间，也可以仅是日期;它不能只是一个时间。预期的格式由计算机的区域时间设置决定。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reference Time")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _reference_time { get; set; } = null;


        /// <summary>
        /// <para>Updated Input Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _updated_table { get; set; }


        public EncodeField SetEnv(object extent = null)
        {
            base.SetEnv(extent: extent);
            return this;
        }

    }

}